package wechat.app

import wechat.base.snd.WCApplication

class WXCorpAppFactory {
	private static WCCorpApplication customerApp = null;
	def static getDefaultCorpApp(){
		if (customerApp==null){
			customerApp = new WCCorpApplication('wx59b4783059880985','-2stl0g0Tfz7CvU4r_45_NVkOD_AhDy8UHST_vZ4Z17u4zIG28lf1vX8ZupfIlVw','0') //yunduo
//			val propertyReader  = new PropertyReader()
//			customerApp = new WCApplication(propertyReader.corpId,propertyReader.SECRET,propertyReader.AGENTID) //yunduo
		}
		customerApp
	}
	def static createCorpApp(String corp_id, String secret, String agent_id){
		if (customerApp==null){
			customerApp = new WCCorpApplication(corp_id, secret, agent_id)
		}
		customerApp
	}
	def static forceNewCorpApp(String corp_id, String secret, String agent_id){
		customerApp = new WCCorpApplication(corp_id, secret, agent_id)
		customerApp
	}	
}

class WCCorpApplication extends WCApplication{
	new (String corp_id, String secret, String agent_id){
		super(corp_id,secret,agent_id)
	}	
}